# Contributor: Matt Dainty <matt+alpine@bodgit-n-scarper.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=corkscrew
pkgver=2.0_git20190118
pkgrel=0
_commit=e351bdaa911b102094e8c9c50e7fafcf4e660a47
pkgdesc="Tool for tunneling SSH through HTTP proxies"
url="https://github.com/bryanpkc/corkscrew"
arch="all"
license="GPL-2.0-or-later"
makedepends="autoconf automake"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/bryanpkc/corkscrew/archive/$_commit.tar.gz
	corkscrew-2.0-from-debian-readme.patch
	corkscrew-2.0-typo.patch
	corkscrew.1
	"
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	default_prepare

	aclocal
	autoheader
	autoconf
	automake --add-missing --force
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dm644 "$srcdir"/corkscrew.1 \
		-t "$pkgdir"/usr/share/man/man1
}

sha512sums="
cbec7f960aab1cc4aa78dfb92c2adb42aa79ffb1a5bed8d47011f34a22cb8591c82d320ead3592ed4ca0291645a25ed0f92c6d4809d06bcfadbd48aa2ee26bcb  corkscrew-2.0_git20190118.tar.gz
2514663f2f120c49b7c0d40246ca5fae49f9c27097c17c38992085bc9f4ae3e2f1a749ceaf400b10b4b68c809365a420865fab90fead585949ad440a19f02aeb  corkscrew-2.0-from-debian-readme.patch
197dd0d3de4a026603af8ea4bf8cdf1d25b7555166b817697474961020491b4f181c67e431f340791f22768c28b40262819780c77055ec3d066c60c19f57ac2e  corkscrew-2.0-typo.patch
a59c99056ef4c12dec854ab0b571b9778b78c3d429193c1365ef2c1a37edb478e8d7e7948e830b22dfe3fb724e6be0b6176ac541da1fa5a2678a608f2b025e90  corkscrew.1
"
